<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFreightWaysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('freight_ways', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('machine_id')->default(0)->comment('设备ID');
            $table->bigInteger('goods_id')->default(0)->comment('商品ID');
            $table->integer('capacity')->default(0)->comment('容量');
            $table->integer('stock')->default(0)->comment('库存');
            $table->integer('stock_warning')->default(0)->comment('库存警告');
            $table->tinyInteger('state')->default(0)->comment('状态');
            $table->decimal('price',10,2)->default(0.00)->comment('销售价');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('freight_ways');
    }
}
